<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>登录 - {:config('web.WEB_TIT')}</title>
	{include file="member/public"}
</head>
<body>
	<div class="logo">
		<a href="/"><img src="__MOBILE__/member_style/images/logo.png" /></a>
	</div>
	<form>
		<input type="text" name="mobile" id="mobile" placeholder="请输入手机号" class="login-password">
		<input type="password" name="password" id="password" placeholder="请输入密码" class="login-name">
		<input type="hidden" name="__token__" id="token" value="{$Request.token}" />
		<input type="submit" id="submit" value="登录" class="money-btn">
	</form>
	<p class="login-text">没有账号？点此
		<a href="{:url('member/register')}" class="reg">注册</a>
		<!--<a href="pwdfind.html" class="password">忘记密码</a>-->
	</p>
	<script type="text/javascript">
        //点击提交按钮
        $('#submit').click(function () {
            //检测
            var mobile = $('#mobile').val();
            if(mobile == '') {
                alert('手机号不能为空');
                return false;
            }
            var password = $('#password').val();
            if(password == ''){
                alert('密码不能为空');
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '{:url("login/member_login")}',
                data: {
                    mobile:mobile,
                    password:password,
                    __token__:$('#token').val(),
                },
                dataType:'json',
                success: function(data){
                    if(data.code == 200){
                        alert(data.msg)
						console.log(1111111)
                        window.location.href = "{:url('my')}";
                        // setTimeout(function(){
                        //     window.location.href = "{:url('member/login')}";
                        // },1000);
                    }else{
                        alert(data.msg)
						console.log(22222222)
						return;
                        // window.location.href = "{:url('/')}";
                    }
                },
            });
        });
	</script>
</body>
</html>
